package commonClass.javaTest;

import java.util.Random;

public class Test {
	public static String output = "";

	public static void foo(int i) {
		try {
			if (i == 1) {
				throw new Exception();
			}
			output += "1";
		} catch (Exception e) {
			output += "2";
			return;
		} finally {
			output += "3";
		}
		output += "4";
	}

	public static void main(String[] args) {
		foo(0);
		foo(1);
		System.out.println(output);
		printPerson();
		print();
	}

	public static void printPerson() {
		int man = 0;
		int woman = 0;
		int kids = 0;
		for (man = 0; man < 36; man++) {
			for (woman = 0; woman < 36; woman++) {
				for (kids = 0; kids < 36; kids++) {
					if (man * 4 + woman * 3 + kids / 2 == 36
							&& man + woman + kids == 36 && kids % 2 == 0) {
						System.out.println("man=" + man + ",woman=" + woman
								+ ",kids=" + kids);
					}
				}
			}
		}
	}

	public static void print() {
		Random random = new Random();
		int n = random.nextInt(100);
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i <= n; i++) {
			int c = random.nextInt(255);
			if ((c <= '9' && c >= '0') || (c <= 'Z' && c >= 'A')
					|| (c <= 'z' && c >= 'a')) {
				sb.append((char) c);
				i++;
			}
		}
		System.out.println(sb.toString());
	}

}
